package com.kh.tool.mapvalidator.exception;

import net.sf.json.JSONArray;
import java.util.Collection;

public class MissingParameterException extends RuntimeException {
    private Collection<Object> errorList;
    private String msg;

    public MissingParameterException(Collection<Object> errorList) {
        super("参数有误");
        this.errorList = errorList;
    }

    @Override
    public String getMessage() {
        JSONArray jsonArray = JSONArray.fromObject(errorList);
        String errorJsonStr = jsonArray.toString();
        return errorJsonStr;
    }

    public Object getMessageBody() {
        return errorList;
    }
}
